<?php
namespace app\common\controller;

use think\Controller;
use think\Request;
use \app\api\model\User;

class Init extends Common
{
    public $User;
    public $UID;
    public $Module;
    public $Controller;
    public $Action;
    public $userObj;

    public function __construct()
    {
        parent::__construct();
        $request = \request();
        $this->Module = strtolower($request->module());
        $this->Controller = strtolower($request->controller());
        $this->Action = strtolower($request->action());

        if($this->Module == 'user' && $this->Controller == 'Auth' && $this->Action == 'refresh_token'){

        } else {
            $Authorization = $request->header('Authorization','');
            $User = jwt2data($Authorization);
            $this->User = $User;
            $this->UID = $User['uid'];
            $this->userObj = new User($User['uid']);
        }
    }


}
